package behavioral.state;

/**
 * @ClassName: MainTest
 * @Description: 测试类
 * @Author: liu-hao
 * @Date: 2023-04-12 09:30
 * @Version: 1.0
 **/
public class MainTest {
    public static void main(String[] args) {
        AudioPlayer audioPlayer = new AudioPlayer();
        audioPlayer.pressPlay(); // 开始播放...

        // 切换播放器内部状态
        audioPlayer.changeState(new PauseState());
        audioPlayer.pressPlay(); // 暂停状态无法播放...
    }
}
